package com.eastfair.builder.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.builder.enumeration.ExhibitorSettleStatusEnum;
import com.eastfair.builder.enumeration.ExhibitorSiteStatusEnum;
import com.eastfair.builder.enumeration.ExhibitorEarnestMoneyPayStatusEnum;
import com.eastfair.builder.enumeration.ExhibitorProcessEnum;
import com.eastfair.builder.enumeration.ExhibitorSiteTypeEnum;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 展商
 * </p>
 *
 * @author dqq
 * @since 2023-06-06
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("bd_exhibitor")
@ApiModel(value = "Exhibitor", description = "展商")
@AllArgsConstructor
public class Exhibitor extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Size(max = 1000, message = "备注长度不能超过1000")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "备注")
    private String remark;

    /**
     * 外部系统展商ID
     */
    @ApiModelProperty(value = "外部系统展商ID")
    @Size(max = 200, message = "外部系统展商ID长度不能超过200")
    @TableField(value = "external_exhibitor_id", condition = LIKE)
    @Excel(name = "外部系统展商ID")
    private String externalExhibitorId;

    /**
     * 展商名称
     */
    @ApiModelProperty(value = "展商名称")
    @Size(max = 100, message = "展商名称长度不能超过100")
    @TableField(value = "exhibitor_name", condition = LIKE)
    @Excel(name = "展商名称")
    private String exhibitorName;

    /**
     * 展商联系人
     */
    @ApiModelProperty(value = "展商联系人")
    @Size(max = 100, message = "展商联系人长度不能超过100")
    @TableField(value = "exhibitor_contacts", condition = LIKE)
    @Excel(name = "展商联系人")
    private String exhibitorContacts;

    /**
     * 展商联系人手机号
     */
    @ApiModelProperty(value = "展商联系人手机号")
    @Size(max = 255, message = "展商联系人手机号长度不能超过255")
    @TableField(value = "exhibitor_contacts_tel", condition = LIKE)
    @Excel(name = "展商联系人手机号")
    private String exhibitorContactsTel;

    /**
     * 展馆编码
     */
    @ApiModelProperty(value = "展馆编码")
    @Size(max = 64, message = "展馆编码长度不能超过64")
    @TableField(value = "space_code", condition = LIKE)
    @Excel(name = "展馆编码")
    private String spaceCode;

    /**
     * 展馆号
     */
    @ApiModelProperty(value = "展馆号")
    @Size(max = 100, message = "展馆号长度不能超过100")
    @TableField(value = "space_name", condition = LIKE)
    @Excel(name = "展馆号")
    private String spaceName;

    /**
     * 展位编码
     */
    @ApiModelProperty(value = "展位编码")
    @Size(max = 64, message = "展位编码长度不能超过64")
    @TableField(value = "site_code", condition = LIKE)
    @Excel(name = "展位编码")
    private String siteCode;

    /**
     * 展位号
     */
    @ApiModelProperty(value = "展位号")
    @Size(max = 100, message = "展位号长度不能超过100")
    @TableField(value = "site_name", condition = LIKE)
    @Excel(name = "展位号")
    private String siteName;

    /**
     * 展位类型 #{SPECIAL:特装;STANDARD:标摊}
     */
    @ApiModelProperty(value = "展位类型 #{SPECIAL:特装;STANDARD:标摊}")
    @TableField(value = "site_type")
    @Excel(name = "展位类型 #{SPECIAL:特装;STANDARD:标摊}", replace = {"特装_SPECIAL", "标摊_STANDARD",  "_null"})
    private ExhibitorSiteTypeEnum siteType;

    /**
     * 展位面积
     */
    @ApiModelProperty(value = "展位面积")
    @TableField(value = "site_area")
    @Excel(name = "展位面积")
    private BigDecimal siteArea;

    /**
     * 展位状态#{UNREPORT:未报馆;REPORTING:报馆中;REPORTED:已报馆;UNAPPROACH:未进场;BUILDING:搭建中;BUILDED:已搭建;SHOW:展览中;DEPOSITING:撤展中;DEPOSIT:已撤展;}
     */
    @ApiModelProperty(value = "展位状态#{UNREPORT:未报馆;REPORTING:报馆中;REPORTED:已报馆;UNAPPROACH:未进场;BUILDING:搭建中;BUILDED:已搭建;SHOW:展览中;DEPOSITING:撤展中;DEPOSIT:已撤展;}")
    @TableField(value = "site_status")
    @Excel(name = "展位状态#{UNREPORT:未报馆;REPORTING:报馆中;REPORTED:已报馆;UNAPPROACH:未进场;BUILDING:搭建中;BUILDED:已搭建;SHOW:展览中;DEPOSITING:撤展中;DEPOSIT:已撤展;}", replace = {"未报馆_UNREPORT", "报馆中_REPORTING", "已报馆_REPORTED", "未进场_UNAPPROACH", "搭建中_BUILDING", "已搭建_BUILDED", "展览中_SHOW", "撤展中_DEPOSITING", "已撤展_DEPOSIT",  "_null"})
    private ExhibitorSiteStatusEnum siteStatus;

    /**
     * 搭建商联系人
     */
    @ApiModelProperty(value = "搭建商联系人")
    @Size(max = 100, message = "搭建商联系人长度不能超过100")
    @TableField(value = "contact", condition = LIKE)
    @Excel(name = "搭建商联系人")
    private String contact;

    /**
     * 搭建商联系人手机号
     */
    @ApiModelProperty(value = "搭建商联系人手机号")
    @Size(max = 255, message = "搭建商联系人手机号长度不能超过255")
    @TableField(value = "contact_mobile", condition = LIKE)
    @Excel(name = "搭建商联系人手机号")
    private String contactMobile;

    /**
     * 是否吊点：0-否，1-是
     */
    @ApiModelProperty(value = "是否吊点：0-否，1-是")
    @TableField(value = "is_point")
    @Excel(name = "是否吊点：0-否，1-是")
    private Integer isPoint;

    /**
     * 是否双层：0-否，1-是
     */
    @ApiModelProperty(value = "是否双层：0-否，1-是")
    @TableField(value = "is_double")
    @Excel(name = "是否双层：0-否，1-是")
    private Integer isDouble;

    /**
     * 搭建商ID
     */
    @ApiModelProperty(value = "搭建商ID")
    @TableField(value = "builder_id")
    @Excel(name = "搭建商ID")
    private Long builderId;

    /**
     * 搭建商名称
     */
    @ApiModelProperty(value = "搭建商名称")
    @Size(max = 100, message = "搭建商名称长度不能超过100")
    @TableField(value = "builder_name", condition = LIKE)
    @Excel(name = "搭建商名称")
    private String builderName;

    /**
     * 展会ID
     */
    @ApiModelProperty(value = "展会ID")
    @TableField(value = "exhibition_manage_id")
    @Excel(name = "展会ID")
    private Long exhibitionManageId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @Size(max = 100, message = "展会名称长度不能超过100")
    @TableField(value = "exhibition_manage_name", condition = LIKE)
    @Excel(name = "展会名称")
    private String exhibitionManageName;

    /**
     * 是否设置了保证金 0:否 1:是
     */
    @ApiModelProperty(value = "是否设置了保证金 0:否 1:是")
    @TableField(value = "is_earnest_money_set")
    @Excel(name = "是否设置了保证金 0:否 1:是")
    private Integer isEarnestMoneySet;

    /**
     * 应缴纳保证金
     */
    @ApiModelProperty(value = "应缴纳保证金")
    @TableField(value = "should_earnest_money")
    @Excel(name = "应缴纳保证金")
    private BigDecimal shouldEarnestMoney;

    /**
     * 实际缴纳的保证金
     */
    @ApiModelProperty(value = "实际缴纳的保证金")
    @TableField(value = "actual_earnest_money")
    @Excel(name = "实际缴纳的保证金")
    private BigDecimal actualEarnestMoney;

    /**
     * (弃用)剩余保证金
     */
    @ApiModelProperty(value = "(弃用)剩余保证金")
    @TableField(value = "remain_earnest_money")
    @Excel(name = "(弃用)剩余保证金")
    private BigDecimal remainEarnestMoney;

    /**
     * 保证金缴纳状态 #{NOT_PAY:未支付;PARTPAY:部分支付;HAS_PAY:已支付;NOT_NEED_PAY:无需缴纳}
     */
    @ApiModelProperty(value = "保证金缴纳状态 #{NOT_PAY:未支付;PARTPAY:部分支付;HAS_PAY:已支付;NOT_NEED_PAY:无需缴纳}")
    @TableField(value = "earnest_money_pay_status")
    @Excel(name = "保证金缴纳状态 #{NOT_PAY:未支付;PARTPAY:部分支付;HAS_PAY:已支付;NOT_NEED_PAY:无需缴纳}", replace = {"未支付_NOT_PAY", "部分支付_PARTPAY", "已支付_HAS_PAY", "无需缴纳_NOT_NEED_PAY",  "_null"})
    private ExhibitorEarnestMoneyPayStatusEnum earnestMoneyPayStatus;

    /**
     * 保证金缴纳时间
     */
    @ApiModelProperty(value = "保证金缴纳时间")
    @TableField(value = "earnest_money_pay_time")
    @Excel(name = "保证金缴纳时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime earnestMoneyPayTime;

    /**
     * 进度#{IS_EARNEST_MONEY_SET:缴纳保证金;ARRANGEMENT:布展验收中;HAS_ARRANGEMENT:布展验收;DISMANTLING:撤展验收中;HAS_DISMANTLING:撤展验收;}
     */
    @ApiModelProperty(value = "进度#{IS_EARNEST_MONEY_SET:缴纳保证金;ARRANGEMENT:布展验收中;HAS_ARRANGEMENT:布展验收;DISMANTLING:撤展验收中;HAS_DISMANTLING:撤展验收;}")
    @TableField(value = "process")
    @Excel(name = "进度#{IS_EARNEST_MONEY_SET:缴纳保证金;ARRANGEMENT:布展验收中;HAS_ARRANGEMENT:布展验收;DISMANTLING:撤展验收中;HAS_DISMANTLING:撤展验收;}", replace = {"缴纳保证金_IS_EARNEST_MONEY_SET", "布展验收中_ARRANGEMENT", "布展验收_HAS_ARRANGEMENT", "撤展验收中_DISMANTLING", "撤展验收_HAS_DISMANTLING",  "_null"})
    private ExhibitorProcessEnum process;

    /**
     * 结算状态 #{NOT_APPLIED:未申请;REQUESTED:已申请;HAS_SETTLE:已结算}
     */
    @ApiModelProperty(value = "结算状态 #{NOT_APPLIED:未申请;REQUESTED:已申请;HAS_SETTLE:已结算}")
    @TableField(value = "settle_status")
    @Excel(name = "结算状态 #{NOT_APPLIED:未申请;REQUESTED:已申请;HAS_SETTLE:已结算}", replace = {"未申请_NOT_APPLIED", "已申请_REQUESTED", "已结算_HAS_SETTLE",  "_null"})
    private ExhibitorSettleStatusEnum settleStatus;

    /**
     * 是否重置(0否1是)
     */
    @ApiModelProperty(value = "是否重置(0否1是)")
    @TableField(value = "is_reset")
    @Excel(name = "是否重置(0否1是)")
    private Integer isReset;

    /**
     * 展商邀请码
     */
    @ApiModelProperty(value = "展商邀请码")
    @Size(max = 100, message = "展商邀请码长度不能超过100")
    @TableField(value = "invite_code", condition = LIKE)
    @Excel(name = "展商邀请码")
    private String inviteCode;


    @Builder
    public Exhibitor(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String remark, String externalExhibitorId, String exhibitorName, String exhibitorContacts, String exhibitorContactsTel, String spaceCode, 
                    String spaceName, String siteCode, String siteName, ExhibitorSiteTypeEnum siteType, BigDecimal siteArea, ExhibitorSiteStatusEnum siteStatus, 
                    String contact, String contactMobile, Integer isPoint, Integer isDouble, Long builderId, String builderName, 
                    Long exhibitionManageId, String exhibitionManageName, Integer isEarnestMoneySet, BigDecimal shouldEarnestMoney, BigDecimal actualEarnestMoney, BigDecimal remainEarnestMoney, 
                    ExhibitorEarnestMoneyPayStatusEnum earnestMoneyPayStatus, LocalDateTime earnestMoneyPayTime, ExhibitorProcessEnum process, ExhibitorSettleStatusEnum settleStatus, Integer isReset, String inviteCode) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.remark = remark;
        this.externalExhibitorId = externalExhibitorId;
        this.exhibitorName = exhibitorName;
        this.exhibitorContacts = exhibitorContacts;
        this.exhibitorContactsTel = exhibitorContactsTel;
        this.spaceCode = spaceCode;
        this.spaceName = spaceName;
        this.siteCode = siteCode;
        this.siteName = siteName;
        this.siteType = siteType;
        this.siteArea = siteArea;
        this.siteStatus = siteStatus;
        this.contact = contact;
        this.contactMobile = contactMobile;
        this.isPoint = isPoint;
        this.isDouble = isDouble;
        this.builderId = builderId;
        this.builderName = builderName;
        this.exhibitionManageId = exhibitionManageId;
        this.exhibitionManageName = exhibitionManageName;
        this.isEarnestMoneySet = isEarnestMoneySet;
        this.shouldEarnestMoney = shouldEarnestMoney;
        this.actualEarnestMoney = actualEarnestMoney;
        this.remainEarnestMoney = remainEarnestMoney;
        this.earnestMoneyPayStatus = earnestMoneyPayStatus;
        this.earnestMoneyPayTime = earnestMoneyPayTime;
        this.process = process;
        this.settleStatus = settleStatus;
        this.isReset = isReset;
        this.inviteCode = inviteCode;
    }

}
